package com.card.hwatt.assembler;

import com.card.hwatt.dto.*;

/**
 * 月考勤统计
 * @author Administrator
 *
 */
public class MonthSumAssembler {

	/**
	 * 
	 * @param monthWork
	 * @param quantity
	 *            出勤员工数量
	 * @param totail
	 *            额定出勤人数
	 * @param days
	 *            工作日数量
	 * @return
	 */
	public static MonthSum convert(MonthWork monthWork, int totail, int days,
			int quantity) {
		MonthSum result = new MonthSum();
		result.d1 = Integer.valueOf(monthWork.d1);
		result.d2 = Integer.valueOf(monthWork.d2);
		result.d3 = Integer.valueOf(monthWork.d3);
		result.d4 = Integer.valueOf(monthWork.d4);
		result.d5 = Integer.valueOf(monthWork.d5);
		result.d6 = Integer.valueOf(monthWork.d6);
		result.d7 = Integer.valueOf(monthWork.d7);
		result.d8 = Integer.valueOf(monthWork.d8);
		result.d9 = Integer.valueOf(monthWork.d9);
		result.d10 = Integer.valueOf(monthWork.d10);
		result.d11 = Integer.valueOf(monthWork.d11);
		result.d12 = Integer.valueOf(monthWork.d12);
		result.d13 = Integer.valueOf(monthWork.d13);
		result.d14 = Integer.valueOf(monthWork.d14);
		result.d15 = Integer.valueOf(monthWork.d15);
		result.d16 = Integer.valueOf(monthWork.d16);
		result.d17 = Integer.valueOf(monthWork.d17);
		result.d18 = Integer.valueOf(monthWork.d18);
		result.d19 = Integer.valueOf(monthWork.d19);
		result.d20 = Integer.valueOf(monthWork.d20);
		result.d21 = Integer.valueOf(monthWork.d21);
		result.d22 = Integer.valueOf(monthWork.d22);
		result.d23 = Integer.valueOf(monthWork.d23);
		result.d24 = Integer.valueOf(monthWork.d24);
		result.d25 = Integer.valueOf(monthWork.d25);
		result.d26 = Integer.valueOf(monthWork.d26);
		result.d27 = Integer.valueOf(monthWork.d27);
		result.d28 = Integer.valueOf(monthWork.d28);
		result.d29 = Integer.valueOf(monthWork.d29);
		result.d30 = Integer.valueOf(monthWork.d30);
		result.d31 = Integer.valueOf(monthWork.d31);

		result.day = monthWork.day;
		result.night = monthWork.night;
		result.full = monthWork.full;
		result.days = monthWork.days;

		result.quantity = quantity;
		result.workDay = days;
		result.totail = totail;
		result.must = totail * days;
		result.need = result.days - result.must;

		result.late = monthWork.late;
		result.early = monthWork.early;

		return result;
	}
}
